﻿@using Kairos.Properties
@using System.Web

<!DOCTYPE html>
<html lang="fr">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta charset="utf-8" />
    <title>@ViewBag.Title - @HttpContext.Current.Application["Title"]</title>
    <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    <meta name="viewport" content="width=device-width" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    @Styles.Render("~/Content/css")
    @Styles.Render("~/Content/themes/base/css")
    @Styles.Render("~/Content/themes/start/css")
    @Styles.Render("~/Content/PagedList")
    @Scripts.Render("~/bundles/modernizr")
</head>
<body>
    <header>
        <div class="content-wrapper">
            <div id="alarms" class="ui-widget"></div>
            <div class="float-left">
                <p class="site-title">
                    @Html.ActionLink((string)HttpContext.Current.Application["Title"], "Index", "Home")
                </p>
            </div>
            <div class="float-right">
                <section id="login">
                    <span class="username">@User.Identity.Name</span>
                </section>
                <nav>
                    <ul id="menu">
                        <li>@Html.ActionLink("Documents", "Document", "Search")</li>
                        <li>@Html.ActionLink("Graphes", "Graphe", "Search")</li>
                        @if (ViewBag.ShouldDisplayUI(Kairos.Roles.Administrator))
                        {
                            <li>@Html.ActionLink("Images", "Index", "Image")</li>
                        }
                        @if (ViewBag.ShouldDisplayUI(Kairos.Roles.Administrator | Kairos.Roles.Worker))
                        {
                            <li id="submenu">
                                <a href="#">Alarmes</a>
                                <ul id="submenu">
                                    <li>@Html.ActionLink("Documents expirés", "Alarme", "Doc")</li>
                                    <li>@Html.ActionLink("Graphes expirés", "Alarme", "Graphe")</li>
                                </ul>
                            </li>
                        }
                        @if (ViewBag.ShouldDisplayUI(Kairos.Roles.Administrator | Kairos.Roles.Worker))
                        {
                            <li>@Html.ActionLink("Vtom", "Index", "Vtom")</li>
                        }
                        @if (ViewBag.ShouldDisplayUI(Kairos.Roles.Administrator))
                        {
                            <li id="submenu">
                                <a href="#">Métadonnées</a>
                                <ul id="submenu">
                                    <li>@Html.ActionLink("Type de document", "Index", "Meta1")</li>
                                    <li>@Html.ActionLink("Logiciel associé", "Index", "Meta2")</li>
                                </ul>
                            </li>
                        }
                    </ul>
                </nav>
            </div>
        </div>
    </header>
    <div id="body">
        @RenderSection("featured", required: false)
        <section class="content-wrapper main-content clear-fix">
            @RenderBody()
        </section>
    </div>
    <footer>
        <div class="content-wrapper">
            <div class="float-left">
                <p>
                    @HttpContext.Current.Application["Title"]
                    @HttpContext.Current.Application["Version"]
                    @HttpContext.Current.Application["Copyright"]
                </p>
            </div>
            <div class="float-right">
                <p id="clock">
                    &nbsp;
                </p>
            </div>
        </div>
    </footer>

    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/alarmes")

    @if (ViewBag.ShouldDisplayUI(Kairos.Roles.Administrator | Kairos.Roles.Worker))
    {
        <script>
            this.alarmes(
                "@((1000 * Settings.Default.JsonInterval).ToString())",
                {
                    AlarmeJson: "@(Url.Action("AlarmeJson", "Home"))",
                    expiredDocuments: "@(Url.Action("Alarme", "Doc"))",
                    expiredGraphes: "@(Url.Action("Alarme", "Graphe"))",
                    unreferencedVtoms: "@(Url.Action("Alarme", "Vtom"))"
                });
        </script>
    }
    @RenderSection("scripts", required: false)

</body>
</html>
